package com.rs.game.npc.combat.impl.rfd;

import com.rs.game.Animation;
import com.rs.game.Entity;
import com.rs.game.Graphics;
import com.rs.game.Hit;
import com.rs.game.npc.NPC;
import com.rs.game.npc.combat.CombatScript;
import com.rs.game.npc.combat.NPCCombatDefinitions;
import com.rs.utils.Utils;



public class Culinaromancer extends CombatScript{
	
	/*
	 * So the combat script will only be used by the NPC 3491
	 */

	@Override
	public Object[] getKeys() {
		return new Object[] {3491};
	}

	/*
	 * The overrided attack.
	 */
	
	@Override
	public int attack(NPC npc, Entity target) {
		final NPCCombatDefinitions defs = npc.getCombatDefinitions();
		if(Utils.getRandom(1) == 0) { 
		   npc.setNextAnimation(new Animation(1979));
		   target.setNextGraphics(new Graphics(369));
		   target.playSound(168, 1);
		   target.addFreezeDelay(5000, true);
		   target.applyHit(new Hit(target, Utils.random((180) + 120), Hit.HitLook.MAGIC_DAMAGE)); //372 is also nice graphics
		} else {
		   target.applyHit(new Hit(target, Utils.random((180) + 180), Hit.HitLook.MELEE_DAMAGE));
		   npc.setNextAnimation(new Animation(805));
		}
		return defs.getAttackDelay();
	}

}
